package comms;

import ap.*;
import agent.*;
/**
 * The Interface which allows interaction with connections for the purpose of
 * sending and receiving concrete Mobile Agents.
 * 
 * @author Kevin
 */
public interface AgentConnection {
	public final static int CLOSED = -1;
	public final static int SENDER_ONLY = 0;
	public final static int RECEIVER_ONLY = 1;
	public final static int SENDER_RECEIVER = 2;

	public boolean sendAgent(AgentPkt agentPack) throws AgentConnectionException;
	
	/**
	 * Sends an agent via the current connection.
	 * 
	 * @param agent
	 * @return True if successful; false otherwise.
	 */
	public boolean sendAgent(MeetingAgent agent) throws AgentConnectionException;
	
	/**
	 * 
	 * @return The status of the connection as indicated by the static constants above.
	 */
	public int getStatus();
	
	/**
	 * Close the current connection.
	 *
	 */
	public void closeConnection();
	
}
